#include <iostream>
using namespace std;

int main(){
    char s[3];
    cin >> s;
    int res = 0;
    res = 10*(s[0]-'0')+(s[1]-'0');
    if (s[2] == 'c')    printf("%.2ff",(1.0*res*9/5+32));
    else printf("%.2fc",(1.0*(res-32)*5/9));
    return 0;
}